package top.xiaoazi.futureletterserver.module.letter.mapper;

import org.apache.ibatis.annotations.Mapper;
import top.xiaoazi.futureletterserver.module.letter.entity.Letter;
import top.xiaoazi.futureletterserver.module.letter.entity.LetterBug;
import top.xiaoazi.futureletterserver.module.letter.vo.LetterSentVO;

import java.util.List;

@Mapper
public interface LetterMapper {
    int send(Letter letter);

    int modifySend(Letter letter);

    List<LetterSentVO> getSentInfo(Integer userId);

    List<LetterSentVO> getWaitingSendInfo(Integer userId);

    List<Letter> getSentAndPubInfo();

    Letter getSentAndPubInfoById(Integer id);

    LetterSentVO getSendInfoById(Integer userId, Integer id);

    List<LetterSentVO> getAwaitSendLetterOnToday(long startTime, long endTime);

    int setState(Letter letter);

    int getCountOnCurUserByState(Integer userId, int state);

    // 这里统计当前用户的公开信，公开信统计必须是已经发送的
    int getCountOnCurUserByPub(Integer userId, int isPub);

    List<Letter> getSentAndPubInfoLimit(Integer pageSize, int offset);

    List<Letter> getSaveInfo(Integer userId);

    LetterSentVO getSaveInfoById(Integer letterId, Integer userId);

    Integer delSaveInfo(Integer id);

    int submitBug(LetterBug letterBug);

    List<LetterBug> getBugs();

    List<LetterBug> getBugsNoSolve();

    int getWaitingSendCount();

    int getSentCount();

    int changeLetterBug(LetterBug letterBug);


}
